
import React from 'react';
import { useDraggable } from '@dnd-kit/core';
import styles from './index.module.less';

export default function DraggableItem({
    disabled,
    id,
    cmd,
    target,
    value,
    index,
    handle,
    renderItem,
    style,
    containerId,
    getIndex,
    wrapperStyle,
}: any) {
    const {
        setNodeRef,
        setActivatorNodeRef,
        attributes,
        listeners,
        isDragging,
        over,
        transform,
    } = useDraggable({
        id,
        data: {
            type: containerId
        },
    });

    return (
        <li
            ref={setNodeRef}
            value={value}
            {...attributes}
            {...listeners}
            className={styles.draggableItem}
        >
            {cmd}
        </li>
    );
}